libxl: Fix segfault in get_all_assigned_devices
authorStefano Stabellini <stefano.stabellini@eu.citrix.com>
Thu, 14 Jul 2011 14:49:49 +0000 (15:49 +0100)
committerStefano Stabellini <stefano.stabellini@eu.citrix.com>
Thu, 14 Jul 2011 14:49:49 +0000 (15:49 +0100)
commitf4766463d45203382484ae77fbbf1f2aa12d5dcb
treeae20c22c926385b31b435653aaf2c69b5edf7176
parent3d250640601709b9a6530453bffdeaeeca57741c
libxl: Fix segfault in get_all_assigned_devices

pcidevs is an array of ndev elements (ndev is the number of pci devices
assigend to a specific domain), but we access pcidevs + *num
where *num is the global number of pci devices assigned so far to all
domains in the system.

Fix the issue removing pcidevs and just realloc'ing *list every time we
want to add a new pci device to the array.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
tools/libxl/libxl_pci.c